#include <stdio.h>
#include <cfloat>

int main()
{
	double num,
		min = DBL_MAX,
		max = DBL_MIN,
		sum = 0.0;
	for (int i = 1; i <= 8; i++)
	{
		printf_s("请输入第%d个分数：", i);
		scanf("%lf", &num);
		if (min > num)
		{
			min = num;
		}
		if (max < num)
		{
			max = num;
		}
		sum += num;
	}

	printf_s("平均分数为：%g\n", (sum - min - max) / 8);
	system("pause");
	return 0;
}